package com.qf.cosmetology.controller;

import com.qf.cosmetology.result.ResponseData;
import com.qf.cosmetology.service.ShopService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * (Shop)表控制层
 *
 * @author makejava
 * @since 2021-06-25 16:17:48
 */
@Api("ShopAPI")
@RestController
@RequestMapping("shops")
public class ShopController {
    /**
     * 服务对象
     */
    @Resource
    private ShopService shopService;

    @ApiOperation(value = "queryById",notes = "通过项目的id获取对应商家的信息")
    @ApiImplicitParam(name="sid",value = "商家id",dataType = "int")
    @GetMapping("/{sid}")
    public ResponseData queryById(@PathVariable Integer sid) {
        return this.shopService.queryById(sid);
    }

    @ApiOperation(value = "getAllShopCount",notes = "获取所有商家总数")
    @GetMapping("/count")
    public Integer getAllShopCount() {
        return this.shopService.getAllShopCount();
    }



}
